var __UICardLevelUp_instance = null;
function getUICardLevelUp() { return __UICardLevelUp_instance; }

var UICardLevelUp = function(){};

UICardLevelUp.prototype.onDidLoadFromCCB = function()
{
    cc.log("UICardLevelUp.onDidLoadFromCCB");
    __UICardLevelUp_instance = this;

    this._curSkill = -1;
};

// 发送设置主界面数据
UICardLevelUp.prototype.updateData = function()
{
    cc.log('UICardLevelUp.updateData');


}


UICardLevelUp.prototype.setCurrent = function(cardId)
{
    cc.log('UICardLevelUp.setCurrent');

    if(cardId < 0) return;

    this._curCard = cardId;

//    this._leftCard = 
    
}


UICardLevelUp.prototype.onLevelUp = function() 
{
    if(this._curSkill == -1) return;
    
    function _func (data) {
        if(data['result']=='ok') {
            // 刷新数据
            DataManager.setData(data['data'])
            // 刷新界面
            getUISkill().updateData();
        }
    };
    gnet.sendHttp("skill_level_up", [this._curSkill], _func);
}


UICardLevelUp.prototype.setCurrent = function(cardId)
{
    cc.log('UICardLevelUp.setCurrent');

    if(cardId < 0) return;

    this._curCard = cardId;

//    this._leftCard = 
    
}

UICardLevelUp.prototype.onCancel = function() 
{
    cc.log('UICardLevelUp.onCancel');
    getUIMain().showUICardLevelUp(false);
}


